Skip to content

feat(integrations): add Pi memory package - #1492

Open
phernandez wants to merge 2 commits into
mainfrom
feat/pi-memory
Open

feat(integrations): add Pi memory package#1492
phernandez wants to merge 2 commits into
mainfrom
feat/pi-memory

Conversation

@phernandez

@phernandez phernandez commented Sep 6, 2026

Copy link
Copy Markdown
Member

Why

Pi users should be able to carry Basic Memory continuity across sessions without starting over: capture the current working thread, open a fresh Pi session, and recover the decision, rationale, blocker, and next step from a real Basic Memory note.

This also proves the transport strategy from #1488: ship one Pi package with shared continuity semantics while supporting both direct Basic Memory CLI access and MCP access through the existing pi-mcp-adapter.

What Changed

  • Added a new Pi package under integrations/pi/ published as @basicmemory/pi-basic-memory.
  • Added a TypeScript Pi extension with:
    • /bm-status
    • /bm-recall
    • /bm-capture
    • bm_recall
    • bm_capture
  • Added project-local configuration via .pi/basic-memory.json, including CLI/MCP mode, explicit project/project-id routing, capture folder, recall timeframe, and opt-in automation settings.
  • Added a Pi-aware active skill, basic-memory-pi, that uses the package's bm_recall and bm_capture tools.
  • Bundled focused canonical Basic Memory skill text as non-active references:
    • memory-notes
    • memory-capture
    • memory-continue
    • memory-tasks
  • Added scripts/fetch-skills.ts and skill-references/manifest.json so the package refreshes bundled references from the monorepo source.
  • Added maintainer documentation and E2E evidence in docs/PI_MEMORY_*.md.
  • Added package/release wiring:
    • just package-check-pi
    • Pi included in just package-check and agent-harness-check
    • version bump support in scripts/update_versions.py
    • release recipes now include Pi package version files.

Implementation Details

The Pi integration is intentionally thin. Basic Memory owns storage, search, graph operations, routing, and authentication; the Pi package owns Pi lifecycle integration, explicit capture/recall commands, and packaging.

CLI mode is the default and shells out to bm tool ... with bounded subprocess timeouts. MCP mode does not implement a new MCP host; it registers Basic Memory with pi-mcp-adapter through the adapter's public runtime registration event. If the adapter is missing, the package reports a visible warning and leaves Pi usable.

Automatic recall and capture default off. Users can start with explicit /bm-recall and /bm-capture before opting into automation. Recalled notes are fenced as reference data, not instructions, and captures are synthesized checkpoints rather than raw transcript dumps.

Testing

Passed:

just package-check-pi

That runs:

npm ci --ignore-scripts
npm run fetch-skills
npm run check-types
npm test
npm pack --dry-run

Also passed:

uv run python scripts/update_versions.py v0.23.3 --scope packages --dry-run
uv run pytest tests/test_update_versions.py -q

Manual isolated E2E evidence is recorded in docs/PI_MEMORY_E2E_RESULTS.md:

  1. CLI capture → fresh CLI recall.
  2. CLI-written note → MCP adapter recall.
  3. MCP adapter write → CLI search/recall.

All E2E runs used temporary BASIC_MEMORY_HOME, BASIC_MEMORY_CONFIG_DIR, Pi session directories, and throwaway Basic Memory projects.

Risks / Follow-ups

  • Pi npm publishing is wired for package checks and version bumps, but the GitHub Actions npm publish step still needs to be added before release.
  • The extension commands are CLI-backed even when transport: "mcp"; MCP mode currently exposes Basic Memory to the model via pi-mcp-adapter.
  • docs.basicmemory.com needs a Pi integration page in a separate docs PR.
  • Broader lifecycle behavior — compaction-aware checkpoints, reload/resume/fork handling, and final automation defaults — remains planned follow-up work.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant